﻿namespace Server.Logic.Common.Utils
{
    public static class TaskExtensions
    {
        private static readonly Logger Log = LogManager.GetCurrentClassLogger();
        
        public static void Forget(this Task task)
        {
            _ = task.ContinueWith(t =>
            {
                if (t.Exception == null)
                    return;

                Log.Fatal(t.Exception);
            }, TaskContinuationOptions.OnlyOnFaulted);
        }
    }
}